<template>
  <view class="box">
    <view class="header">
      <view class="h-item active">
        <view class="h-icon">
          <text class="iconfont icon-shenfenzheng"></text>
        </view>
        <text class="h-txt">实名认证</text>
      </view>
      <view class="h-item active">
        <view class="h-icon">
          <text class="iconfont icon-creditcard-fill"></text>
        </view>
        <text class="h-txt">添加银行卡</text>
      </view>
      <view class="h-item active">
        <view class="h-icon"><text class="icon-qiandai iconfont"></text></view>
        <text class="h-txt">审核下款</text>
      </view>
    </view>
    <view class="desc">请保证填写信息的准确！</view>
    <view class="wrap">
      <view class="title">
        <view>正在进行认证审核</view>
        <view>请稍后...</view>
      </view>
      <view class="list-box">
        <view class="list">
            <view class="item" :key="index" :class="{show:step>index}" v-for="(item,index) in list">
              <view class="item-left">
                <text class="iconfont" :class="item.icon"></text>
                <text class="type">{{item.txt}}</text>
              </view>
              <view class="item-right">
                <text class="iconfont" :class="item.type ? 'icon-wancheng':'icon-logind'"></text>
                <text>{{item.type ? '已完成':'检测中'}}</text>
              </view>
            </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: "attest1",
  data() {
    return {
      form: {
        name: ''
      },
      show: false,
      show2:false,
      step:0,
      list:[
        {
          txt:'身份实名审核',
          icon:'icon-shenfenzheng',
          type:false
        },
        {
          txt:'黑名单检测',
          icon:'icon-heimingdan',
          type:false
        },
        {
          txt:'手机风险检测',
          icon:'icon-shouji',
          type:false
        },
        {
          txt:'银行卡风险检测',
          icon:'icon-creditcard-fill',
          type:false
        }
      ]
    }
  },
  created() {
    let timer = setInterval(()=>{
      this.step++
      setTimeout(()=>{
        this.list[this.step-1].type = true
      },2000)
      if(this.step >=4){
        clearInterval(timer)
        setTimeout(()=>{
          uni.redirectTo({
            url:'/pages/user/withdraw'
          })
        },2000)
      }
    },3000)
  },
  methods:{

  }
}
</script>

<style scoped lang="scss">
@import '~@/static/font/iconfont.scss';

.header {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100rpx;
  background-color: #fff;

  .h-item {
    box-sizing: border-box;
    position: relative;
    width: 200rpx;
    height: 50rpx;
    line-height: 46rpx;
    text-align: center;
    border-radius: 50rpx;
    border: 2rpx solid #999;
    font-size: 24rpx;

    .h-icon {
      position: absolute;
      left: -20rpx;
      top: 50%;
      transform: translateY(-50%);
      width: 56rpx;
      height: 56rpx;
      display: flex;
      justify-content: center;
      align-items: center;
      border-radius: 50%;
      border: 2rpx solid #999;
      background-color: #fff;
      color: #bbb;
    }

    .h-txt {
      letter-spacing: 1px;
    }

    &.active {
      background-color: #2E82E7;
      color: #fff;
      border-color: #fff;

      .h-icon {
        background-color: #2E82E7;
        border-color: #fff;
        color: #fff;
      }
    }
  }
}

.desc {
  height: 80rpx;
  line-height: 80rpx;
  text-align: center;
  background-color: #eee;
  color: #999;
}

.wrap{
  .title{
    padding-top: 100rpx;
    text-align: center;
    color: #5C69E3;
    font-size: 30rpx;
    font-weight: bold;
  }
  .list-box{
    position: relative;
    width: 630rpx;
    height: 450rpx;
    margin: 0 auto;
  }
  .list{
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-sizing: border-box;
    height: 450rpx;
    padding: 0 40rpx;
    border-radius: 20rpx;
    background-color: #fff;
    &:after {
      height: 50rpx;
      width: 600rpx;
      content: "";
      position: absolute;
      background: white;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      /*设置副阴影在主阴影的下面*/
      z-index: -1;
      box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
      border-radius: 100px/10px;
    }
      /*&:before{
        position: absolute;
        z-index: -10;
        left: 0;
        bottom: -20rpx;
        content: ' ';
        width: 300rpx;
        height: 200rpx;
        border-radius: 20rpx;
        transform: rotate(-5deg);
        box-shadow: -5px 5px 20px 5px rgba(0,0,0,.2);
      }*/
    .item{
      opacity: 0;
      height: 100rpx;
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: opacity .5s;
      &.show{
        opacity: 1;
      }
      .item-left{
        .iconfont{
          font-size: 26rpx;
          border: 1px solid #2E82E7;
          padding: 10rpx;
          border-radius: 50%;
          color: #2E82E7;
          margin-right: 20rpx;
        }
      }
      .item-right{
        .iconfont{
          font-size: 30rpx;
          padding: 10rpx;
          border-radius: 50%;
          color: #2E82E7;
          margin-right: 10rpx;
        }
      }
    }
  }
}
@keyframes myfirst
{
  from {transform: rotate(0deg);}
  to {transform: rotate(360deg)}
}
.icon-logind{
  display: inline-block;
  animation: myfirst 1s infinite linear;
  transition: all .3s;
  color: #2E82E7;
  margin-right: 20rpx;
}

</style>
